﻿using System.Windows;
using System.Windows.Forms;
using Spriter.Ui.ViewModels.UserControls;

namespace Spriter.Ui.UserControls
{
    /// <summary>
    ///     Interaction logic for FolderPicker.xaml
    /// </summary>
    public partial class FolderPicker
    {
        public FolderPicker()
        {
            ViewModel = new FolderPickerViewModel();
            DataContext = ViewModel;
            InitializeComponent();
        }

        public FolderPickerViewModel ViewModel { get; private set; }

        private void PickFolder(object sender, RoutedEventArgs e)
        {
            var dialog = new FolderBrowserDialog();

            var result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                ViewModel.FolderPath = dialog.SelectedPath;
            }
        }
    }
}